<?php
namespace Home\Controller;
use Think\Controller;
class CommonController extends Controller {
	public function _initialize(){
		S(array(
			'type'=>'memcache',
			'host'=>'locahost',
			'port'=>'11211',
			'prefix'=>'think',
			'expire'=>0)
		);
		
	}
    public function response($staus,$count,$data,$exit = false){
       $return = array(
			'staus' => $staus,
			'count' => $count,
			'data'  => $data,
		);
       $this->ajaxReturn($return);
       if($exit == false ){
			exit;
	   }
    }
    public function isAuth(){
		if(isset($_SESSION['user_id']) && $_SESSION['user_id'] != ''
			&&isset($_SESSION['user_nickname']) && $_SESSION['user_nickname'] != ''
				&&isset($_SESSION['head_img']) && $_SESSION['head_img'] != '')
			{   
				$Auth = new \StdClass();
				$Auth->UID  = $_SESSION['user_id'];
				$Auth->NICKNAME  = $_SESSION['user_nickname'];
				$Auth->HEAD_IMG  = $_SESSION['head_img'];
				return $Auth;
			}
		return false;
	}
}
